Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click, Button2.Click, Button3.Click, Button4.Click
        Dim sum&
        sum = Fact(sender.TAG)     'ʵSumͱβFactһ£Long
        If sender.TAG = 7 Then sum = Fact(5) + Fact(6) + Fact(8)
        Label1.Text = sender.Text & " = " & sum
End Sub
׳nͨùFactΪ
Private Function Fact(ByVal n As Integer) As Long
        Dim i As Integer
        Fact = 1
        For i = 1 To n
            Fact = Fact * i
        Next
End Function 
